package models

import "strconv"

type LingQianRequest struct {
	MchAppId    string `form:"mchappid"` 	//  appid
	OpenId      string `form:"openid"`   	//  用户openid
	Amount      int    `form:"amount"`   	// 	发放的钱数目(单位:分,最少30)
	RequestTime int64  `form:"retime"`   	//  申请时间戳(超过30秒订单不会支付)
	ReBillno    string `form:"rebillno"` 	//  申请订单号(随机32位字符串)
	DESC 		string `form:"desc"`		//  描述信息
	Sign        string `form:"sign"`     	//  签名
}

// 获取请求的签名信息
func (this *LingQianRequest) GetSignInfos() map[string]interface{} {
	var mapParams map[string]interface{}
	mapParams = make(map[string]interface{})
	mapParams["mchappid"] = this.MchAppId
	mapParams["openid"] = this.OpenId
	mapParams["amount"] = strconv.Itoa(this.Amount)
	mapParams["retime"] = strconv.FormatInt(this.RequestTime, 10)
	mapParams["rebillno"] = this.ReBillno
	return mapParams
}

type QueryUserRequst struct {
	WxCode string `form:"wxcode"` //  wxcode
	Sign   string `form:"sign"`   //  签名
}

// 获取请求的签名信息
func (this *QueryUserRequst) GetSignInfos() map[string]interface{} {
	var mapParams map[string]interface{}
	mapParams = make(map[string]interface{})
	mapParams["wxcode"] = this.WxCode
	return mapParams
}

type UserShareRequest struct {
	WxCode 		string `form:"code"`				// 用户登录网站的授权code
	InviteCode 	string `form:"inviteCode"`			// 用户的上级邀请码
	Sign 		string `form:"sign"`			// 用户的上级邀请码
}

// 获取请求的签名信息
func (this *UserShareRequest) GetSignInfos() map[string]interface{} {
	var mapParams map[string]interface{}
	mapParams = make(map[string]interface{})
	mapParams["code"] = this.WxCode
	mapParams["inviteCode"] = this.InviteCode
	return mapParams
}

type QueryUserShareRequest struct {
	UnionId 		string `form:"unionid"`				// 用户唯一标识
}

type RecoderCurrencyRequest struct {
	UnionId 		string `form:"unionid"`				// 用户唯一标识
	OpenId      	string `form:"openid"`   			//  用户openid
	NickName      	string `form:"nickname"`   			//  昵称
	Change 			int64  `form:"change"`				//  变动数值
	Remind          int64  `form:"remind"`				//  剩余数值
	Desc            string `form:"desc"`				//  变动描述
	Sign   			string `form:"sign"`   				//  签名
}

// 获取请求的签名信息
func (this *RecoderCurrencyRequest) GetSignInfos() map[string]interface{} {
	var mapParams map[string]interface{}
	mapParams = make(map[string]interface{})
	mapParams["unionid"] = this.UnionId
	mapParams["openid"] = this.OpenId
	mapParams["nickname"] = this.NickName
	mapParams["change"] = strconv.FormatInt(this.Change,10)
	mapParams["remind"] = strconv.FormatInt(this.Remind,10)
	return mapParams
}